<!--
 * @Author: linzaifei 1609781601@qq.com
 * @Date: 2025-05-26 09:16:44
 * @LastEditors: linzaifei 1609781601@qq.com
 * @LastEditTime: 2025-08-08 16:13:02
 * @FilePath: /vue3-cesium-plus/src/components/control/vc-search.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="vc-login-control"  >
        <span v-if="!accountStore.isLogin" @click="login" >登录</span>
        <el-avatar v-else-if="accountStore.account.user" :size="30" :src="accountStore.account.user.avr"/>
        <el-avatar v-else :size="30">无</el-avatar>
        <login-dialog  ref="loginDialogRef"/>
    </div>
  </template>
  
<script setup lang="ts">
import { ref } from 'vue'
import LoginDialog from './login-dialog.vue'
import {useAccountStore} from '@/stores'
const loginDialogRef = ref()

const accountStore = useAccountStore()


const login = ()=>{
  console.log('login')
  loginDialogRef.value.open()
}
</script>
  
<style scoped lang="scss">
  .vc-login-control{
    height: 20px;
    line-height: 20px;
    .el-avatar{
      height: 20px;
      width: 20px;
    }
    
}
</style>